import request from '@/router/axios'
import { baseUrl } from '../baseUrl'

export const getCerList = (page, size, params) => {
  return request({
    url: baseUrl + '/certificates',
    method: 'get',
    params: {
      ...params,
      page,
      size
    }
  })
}

export const getCerDetail = (row) => {
  return request({
    url: baseUrl + `/certificates/${id}`,
    method: 'get',
    data: row
  })
}

export const removeCer = (id) => {
  return request({
    url: baseUrl + `/certificates/${id}`,
    method: 'delete'
  })
}

export const addCer = (row) => {
  return request({
    url: baseUrl + '/certificates',
    method: 'post',
    data: row
  })
}

export const updateCer = (row) => {
  return request({
    url: baseUrl + `/certificates/${row.id}`,
    method: 'put',
    data: row
  })
}
